/* 
 * File:   Intersection.h
 * Author: mikey
 *
 * Created on August 25, 2010, 10:03 PM
 */

#ifndef INTERSECTION_H
#define	INTERSECTION_H

#include "Road.h"
#include "TrafficLight.h"

#define vSpace "          "
#define hBar "----------"
#define hRoadDivide " - - - - - "

class Intersection {
public:
    Intersection();
    Intersection(int, int);         // Fully described intersection with number of horizontal and vertical lanes.
    void setHProbability(float);    // Set the probability of a car entering the horizontal road.
    void setVProbability(float);    // Set the probability of a car entering the vertical road.
	void setHLanes(int hLanes);		// Set the horizontal lanes/road. Made to replace the need to recreate the intersection j all the time.
	void setVLanes(int vLanes);		// Set the vertical lanes/road. Made to replace the need to recreate the intersection j all the time.
	Road getHRoad();                // Returns horizontal road object for data manipulation.
    Road getVRoad();                // Returns vertical road object for data manipulation.
    string getState();              // Returns the state of the intersection as a string.
    void runCycle();                // Runs one cycle of simulation.
private:
    Road hRoad;
    Road vRoad;
    TrafficLight hLight;
    TrafficLight vLight;
};

#endif	/* INTERSECTION_H */

